#include <bits/stdc++.h>
using namespace std;
using ll = long long;

void solve(){
    int n;
    cin >> n;
    vector<ll> a(n);
    for(auto& x : a) cin >> x;
    if(n % 2 == 0){
        ll ans = 0;
        for(int i = 0; i < n; i += 2){
            ans = max(ans, a[i + 1] - a[i]);
        }
        cout << ans << endl;
        return;
    }
    ll l = 1, r = 1e18;
    while(l < r){
        ll mid = l + r >> 1;
        auto check = [&](ll k)->bool{
            int f = 0;
            for(int i = 0; i < n; i += 2){
                if(a[i + 1] - a[i] > k && !f){
                    i--;
                    f = 1;
                }else if(a[i + 1] - a[i] > k){
                    return false;
                }
            }
            return true;
        };
        if(check(mid)) r = mid;
        else l = mid + 1;
    }
    cout << l << endl;
}

int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int t;
    cin >> t;
    while(t--) solve();
    return 0;
}